import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)


import indexpage from "../page/indexpage.vue"
import index from "../page/comne/index.vue"
import goodslist from "../page/comne/goodslist.vue"
import user from "../page/comne/user.vue"
import login from "../page/login.vue"
import register from "../page/register.vue"
import shoppinglist from "../page/shoppinglist.vue"
import shoppinglist2 from "../page/shoppinglist2.vue"
import detail from "../page/detail.vue"
import shoppingcar from "../page/comne/shoppingcar.vue"
import paynow from "../page/paynow.vue"
import addpath from "../page/addpath.vue"
import addpaths from "../page/addpaths.vue"
import pay from "../page/pay.vue"

const router = new VueRouter({
  routes:[{
    path:"/login",
    component:login
  },{
    path: "/indexpage",
    component: indexpage,
    children: [
      {
        path: "index",
        component: index,
      },{
        path: "goodslist",
        component: goodslist,
      },{
        path: "user",
        component: user,
      },
      {
        path:"shoppingcar",
        component:shoppingcar,
      },
      {
        path:"",
        redirect: "index",
      }
    ]
  },
  {
    path:"/shoppinglist",
    component:shoppinglist,
  },
  {
    path:"/shoppinglist2",
    component:shoppinglist2,
  },
  {
    path:"/detail",
    component:detail,
  },
  {
    path:"/paynow",
    component:paynow,
  },
  {
    path:"/addpath",
    component:addpath,
  },
  {
    path:"/register",
    component:register,
  },
  {
    path:"/addpaths",
    component:addpaths,
  },
  {
    path:"/pay",
    component:pay,
  },
  {
    path:"*",
    redirect:"/login"
  }
],
})

export default router
